﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using Ngilead.Test.DAO;
using Ngilead.Core;
using Ngilead.Nhibernate;

namespace Ngilead.Web
{
    public class Global : System.Web.HttpApplication
    {

        protected void Application_Start(object sender, EventArgs e)
        {
            Console.WriteLine("Ngilead Web :");

            // PersistentBeanManager with NhibernatePersistentUtil
            Console.WriteLine("\n* PersistentBeanManager");

            // Context
            NhibernateContext.Context = NhibernateContext.enumContext.Stateless;
            Console.WriteLine("\n  NhibernateContext : {0}", NhibernateContext.Context.ToString());

            Console.WriteLine("\n  SessionFactory");
            NhibernatePersistentUtil.Instance.SessionFactory = NhibernateContext.SessionFactory;

            Console.WriteLine("\n  NhibernatePersistentUtil");
            PersistentBeanManager.Instance.PersistenceUtil = NhibernatePersistentUtil.Instance;

        }

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}